<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../org/angular.min.js"></script>
    <script src="../org/jquery.min.js"></script>
    <script src="../org/angular-ui-router.min.js"></script>
</head>
<body>
<div ng-app="hd">
    <div ui-view=""></div>
</div>
<script>
    var m = angular.module('hd', ['ui.router']);
    m.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
        //默认路由
        $urlRouterProvider.otherwise('/my');
        //定义路由规则
        $stateProvider
                .state('my', {
                    resolve:{
                        web:['$http',function($http){
                            return $http({method:'get','url':'1.php'});
                        }]
                    },
                    url: '/my',
                    templateUrl:'view/my.html',
                    controller:['$scope','web',function($scope,web){
                        $scope.data = web.data;
                    }]
                })
    }]);
</script>
</body>
</html>